/**
 * Copyright (c) 2006, PORTALIER Julien
 * 
 * Licensed under The LGPL License
 * Redistributions of files must retain the above copyright notice.
 * 
 * @package    Feather-CM
 * @subpackage Javascript
 * @copyright  Copyright (c) 2006, Julien PORTALIER
 * @link       http://portalier.com/feather
 * @license    http://www.opensource.org/licenses/lgpl-license.php The LGPL License
 */
Fx.Openclose = new Class(
{
	initialize: function(header, content)
	{
		header = $(header).addEvent('click', this.toggle.bindWithEvent(this));
		this.content = $(content || header.id + 'Content').hide();
	},
	
	toggle: function(evt)
	{
		this.content.toggle();
		evt.stop();
	}
});

Window.onDomReady(function() {
	$ES('.openclose').each(function(el) { new Fx.Openclose(el); });
});